<?php
/**
 * Created by PhpStorm.
 * User: ciwei
 * Date: 2017/12/4
 * Time: 8:50
 */
namespace app\index\validate;

use \think\Validate;

class Question extends Validate
{
    protected $rule = [
        'cid'  =>  'require|number',
        'title' =>  'require|length:6,18',
        'content' => 'require|length:6,600',
        'kiss'=>'require|between:20,100',
    ];

    protected $message = [
        'cid.require' => '分类必须选择',
        'cid.number'  => '分类格式不正确',
        'title.require'=>'标题不能为空',
        'title.length'=>'标题长度不对',
        'content.length' => '内容长度不符',
        'content.require' => '内容不能为空',
        'kiss' => '飞吻不对',
    ];

    protected $scene = [
        'answer'  =>  [
            'content'
        ],
    ];
}